#pragma once

#include <string>
#include <memory> 
#include <chrono>

namespace vbase
{
    class vtime
    {
        public:
            vtime();
            ~vtime();

        public:
            //format is: 2020-11-24 15:15:22.999
            static std::string now();

            //format is: 2020-11-24 15:15:22
            static std::string now_fmt1();

            //format is: 2020-11-24 15:15:22
            static std::string from_time_t(time_t time_sec);

            //format must be: 2020-11-24 15:15:22
            static time_t to_time_t(const std::string & time_str);

            static void ssleep(int time_s);
            static void msleep(int time_ms);
            static void usleep(int time_us);

            static std::chrono::system_clock::duration::rep get_time();

            static std::shared_ptr<std::ostringstream> get_oss();

        protected:
    };

}

